package com.mud.mudcommune.view.fragment.threeLevel;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.mud.mudcommune.R;
import com.mud.mudcommune.adapter.EvaluateAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by zhoujin on 2016/12/12.
 */

public class EvaluateFragment extends Fragment {
    private static Fragment fragment = new EvaluateFragment();
    @BindView(R.id.eval_list)
    ListView evalListView;
    private EvaluateAdapter adapter;
    private List evalList;
    Unbinder unbinder;

    public static Fragment getInstance() {
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_evaluate, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        unbinder = ButterKnife.bind(this, view);
        evalList = new ArrayList();
        evalList.add("1");
        evalList.add("2");
        evalList.add("3");
        evalList.add("1");
        evalList.add("2");
        evalList.add("3");
        adapter = new EvaluateAdapter(evalList);
        evalListView.setAdapter(adapter);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        unbinder.unbind();
    }
}
